From: Ray Strode Date: Mon, 25 Mar 2013 15:31:56 +0000 (-0400) Subject: workspaceThumbnail: always destroy bgManager when destroyed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4395 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=18d850d7d681ac011b45ea04fefb8a7e96db42b5;p=gnome-shell.git workspaceThumbnail: always destroy bgManager when destroyed Right now we only destroy the bgManager object when the workspaceThumbnail is explicitly destroy with its destroy() method. This commit makes sure bgManager gets destroyed when the workspaceThumbnail actor is destroyed without calling destroy(). https://bugzilla.gnome.org/show_bug.cgi?id=696157 --- diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 689ded035..6b631d1d9 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -384,9 +384,8 @@ const WorkspaceThumbnail = new Lang.Class({ }, destroy : function() { - this.actor.destroy(); - this._bgManager.destroy(); - this._bgManager = null; + if (this.actor) + this.actor.destroy(); }, workspaceRemoved : function() { @@ -407,6 +406,11 @@ const WorkspaceThumbnail = new Lang.Class({ _onDestroy: function(actor) { this.workspaceRemoved(); + if (this._bgManager) { + this._bgManager.destroy(); + this._bgManager = null; + } + this._windows = []; this.actor = null; },